<extend name="./Application/Common/View/block/base.php" />
<block name="header">
    <link href="__PUBLIC__/css/table_form.css" rel="stylesheet" type="text/css" />
    <script src='__PUBLIC__/assets/js/jquery.js'></script>
    <script language="javascript" type="text/javascript" src="__PUBLIC__/js/formvalidator.js" charset="UTF-8"></script>
    <script language="javascript" type="text/javascript" src="__PUBLIC__/js/formvalidatorregex.js" charset="UTF-8"></script>
</block>
<block name="bdoy">
    <body>
    <form action="" method="post">
        <input type="hidden" name="id" value="{$exam['id']}"/>
        <div>
            <label>{:LANG('examname')}</label>
            <input type="text" name="examname" id="examname" value="{$exam['examname']}"/>
        </div>
        <div>
            <input type="submit" value="{:LANG('save')}"/>
        </div>
    </form>
    </body>
</block>
<block name="footExtendJs">
    <script>
        $(function(){
            $.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
            $("#examname").formValidator({onshow:"{:LANG('inputexam')}",onfocus:"{:LANG('examform')}"}).inputValidator({min:2,max:50,onerror:"名称应该为2-50位之间"}).ajaxValidator({
                type : "get",
                url : "__URL__/check_name",
                data :"",
                datatype : "json",
                async:'false',
                success : function(data){
                    if( data.status == 0 ){
                        return true;
                    }
                    else{
                        return false;
                    }
                },
                buttons: $("#dosubmit"),
                onerror : "{:LANG('examexist')}。",
                onwait : "{:LANG('watting')}"
            });
        });
    </script>
</block>
